image: alpine

stages:
  - compile
  - test
  - package

compile:
  stage: compile
  script: echo Hello world > compiled.txt
  artifacts:
    paths:
    - compiled.txt
    expire_in: 10 minutes

test:
  stage: test
  script: cat compiled.txt | grep -q 'Hello world'

pack-gz:
  stage: package
  script: cat compiled.txt | gzip > packaged.gz
  artifacts:
    paths:
    - packaged.gz
    expire_in: 10 minutes

pack-iso:
  stage: package
  before_script:
  - echo "ipv6" >> /etc/modules
  - apk update
  - apk add xorriso
  script:
  - mkisofs -o ./packaged.iso ./compiled.txt
  artifacts:
    paths:
    - packaged.iso
    expire_in: 10 minutes